<template>
  <div>
    <article>
      <h1>路线/站点信息</h1>
      <section class="hot_stations">
        <h2>热门站点信息</h2>
        <div class="station_info">
          <a
            href="javascript:void(0);"
            class="station_link"
            v-for="(item, index) in hotStations"
            :key="index"
            @mousemove.self="bgcPlus"
            @mouseleave.self="bgcSub"
          >
            <div class="station_txt">
              <h2>{{item.name}}</h2>
            </div>
            <div class="station_pos">
              <span class="pos" v-for="(info, index) in item.pos" :key="index">
                <img :src="info.line" alt class="line_logo" />
                <p>{{info.station}}</p>
              </span>
            </div>
          </a>
        </div>
      </section>
      <div class="station_search">
        <h2>站查询</h2>
        <div class="formBtn">
          <input type="text" placeholder="站名" class="search" />
          <input type="button" value />
        </div>
        <p>
          <a href="javascript:void(0);">按拼音查找</a>
        </p>
      </div>
      <section class="line_card">
        <h2>查看线路信息</h2>
        <div class="line_wrap">
          <div class="line_list">
            <ul>
              <li>
                <router-link to="/station.html/lineone">
                  <img src="/img/station/icon_line1.png" alt />
                  <span>一号线</span>
                </router-link>
              </li>
              <li>
                <router-link to="/station.html/linetwo">
                  <img src="/img/station/icon_line2.png" alt />
                  <span>二号线</span>
                </router-link>
              </li>
              <li>
                <router-link to="/station.html/linethree">
                  <img src="/img/station/icon_line3.png" alt />
                  <span>三号线</span>
                </router-link>
              </li>
              <li>
                <router-link to="/station.html/linefour">
                  <img src="/img/station/icon_line4.png" alt />
                  <span>四号线</span>
                </router-link>
              </li>
            </ul>
          </div>
          <div class="route_area">
            <router-view></router-view>
          </div>
        </div>
      </section>
      <div class="related_link">
        <h2>相关链接</h2>
        <div class="link_wrap">
          <a href="javascript:void(0);" v-for="(item, index) in relatedLink" :key="index">
            <div class="link_item">
              <p>{{item.text}}</p>
              <div class="pic">
                <img :src="item.icon" alt />
              </div>
            </div>
          </a>
        </div>
      </div>
    </article>
  </div>
</template>

<script>
export default {
  data() {
    return {
      hotStations: [
        {
          name: "八一广场站",
          pos: [
            { line: "/img/station/line1_logo.png", station: "12站" },
            { line: "/img/station/line2_logo.png", station: "23站" }
          ]
        },
        {
          name: "谢家村站",
          pos: [{ line: "/img/station/line1_logo.png", station: "18站" }]
        },
        {
          name: "地铁大厦",
          pos: [
            { line: "/img/station/line1_logo.png", station: "17站" },
            { line: "/img/station/line2_logo.png", station: "17站" }
          ]
        },
        {
          name: "南昌火车站",
          pos: [{ line: "/img/station/line2_logo.png", station: "26站" }]
        },
        {
          name: "南昌西站",
          pos: [{ line: "/img/station/line2_logo.png", station: "09站" }]
        },
        {
          name: "卫东",
          pos: [{ line: "/img/station/line1_logo.png", station: "18站" }]
        }
      ],
      relatedLink: [
        { text: "下载应用程序", icon: "/img/station/img_01.png" },
        { text: "运行路线图", icon: "/img/station/img_02.png" },
        { text: "查看票价、换乘", icon: "/img/station/img_05.png" },
        { text: "袖珍安全指南", icon: "/img/station/img_04.png" }
      ]
    };
  },
  methods: {
    bgcPlus(e) {
      e.target.style.backgroundColor = "rgba(12,12,12,.16)";
    },
    bgcSub(e) {
      e.target.style.backgroundColor = "";
    }
  }
};
</script>

<style scoped>
@media screen and (min-width: 806px) {
  .formBtn {
    position: relative;
    width: 556px;
    margin: 0 auto;
  }

  .search {
    display: block;
    width: 556px;
    height: 45px;
    font-size: 1.3rem;
    outline: none;
    border: 2px solid #9bafb5;
    border-radius: 27px;
    padding: 0 20px;
    margin: 0 auto;
  }
  .station_search input[type="button"] {
    right: -25px;
  }
  .line_list > ul > li {
    flex: 1;
  }
  .link_wrap > a {
    min-height: 100px;
    width: 23.1%;
    font-size: 0.9rem;
  }
}
@media screen and (max-width: 807px) {
  .hot_stations {
    display: none;
  }
  .route_area {
    display: none;
  }
  .line_list > ul {
    display: flex;
    flex-wrap: wrap;
    padding: 0 10%;
  }
  .line_list > ul > li {
    margin-top: 3px;
    width: 100%;
    box-sizing: border-box;
  }
  .formBtn {
    position: relative;
    width: 90%;
    margin: 0 auto;
  }

  .search {
    display: block;
    width: 100%;
    height: 45px;
    font-size: 1.3rem;
    outline: none;
    border: 2px solid #9bafb5;
    border-radius: 27px;
    padding: 0 20px;
    margin: 0 auto;
    box-sizing: border-box;
  }
  .station_search input[type="button"] {
    right: 20px;
  }
  .link_wrap > a {
    height: 150px;
    width: 80%;
    font-size: 1.4rem;
    margin: 0 2px;
    padding: 0 10%;
  }
}
article > h1 {
  padding-top: 124px;
  text-align: center;
  position: relative;
  word-break: break-all;
  font-size: 2.8rem;
  padding-bottom: 20px;
  color: #00467e;
  margin-bottom: 100px;
}
article > h1::before {
  display: block;
  content: "";
  position: absolute;
  width: 49px;
  height: 4px;
  background-color: #00a3d6;
  bottom: 0;
  left: 50%;
  margin-left: -49px;
}

article > h1::after {
  display: block;
  content: "";
  position: absolute;
  width: 49px;
  height: 4px;
  background-color: #00467e;
  bottom: 0;
  right: 50%;
  margin-right: -50px;
}
article h2 {
  font-size: 2.2rem;
  color: #00467e;
  text-align: center;
}
.hot_stations {
  max-width: 1280px;
  padding: 0 108px;
  margin: 0 auto;
}
.station_info {
  display: flex;
  margin-top: 40px;
  justify-content: space-between;
  flex-wrap: wrap;
  box-sizing: border-box;
}
.station_info > .station_link {
  position: relative;
  flex-direction: column;
  width: 31%;
  border: 2px solid #ccc;
  min-height: 190px;
  border-radius: 5px;
  padding: 25px 0 32px;
  margin-bottom: 30px;
  transition: background-color 0.3s;
}
.station_link::after {
  content: "";
  position: absolute;
  bottom: 10px;
  right: 10px;
  display: block;
  width: 12px;
  height: 10px;
  background: url(/img/station/icon_blank_gray.png) no-repeat;
  background-size: contain;
}
.station_link > .station_txt {
  padding-bottom: 50px;
}
.station_link > .station_txt > h2 {
  text-align: center;
  margin-top: 25px;
  color: black;
  font-size: 1.6rem;
}
.station_pos {
  /* margin-top: 20px; */
  text-align: center;
  /* display: flex */
}
.station_pos > .pos {
  display: inline-block;
  width: 30%;
  text-align: center;
}
.station_pos .line_logo {
  width: 80px;
  display: inline-block;
}
.station_pos > .pos > p {
  font-size: 1.6rem;
  color: black;
}
.station_search {
  margin-top: 50px;
  text-align: center;
}

.station_search > h2 {
  margin-bottom: 30px;
}

.search:hover {
  border: 2px solid #00a3d6;
}
.station_search > p {
  display: inline-block;
  color: #00467e;
  padding-top: 30px;
}
.station_search > p > a:hover {
  text-decoration: underline;
}
.station_search > p > a::after {
  content: "";
  display: inline-block;
  width: 12px;
  height: 10px;
  background: url(/img/station/icon_blank_gray.png) no-repeat;
  background-size: 12px auto;
  margin-left: 5px;
}
.station_search input[type="button"] {
  position: absolute;
  top: 9px;
  width: 35px;
  height: 35px;
  background: url("/img/header/icon_header_search.png") no-repeat;
  background-size: 30px auto;
  border: none;
  cursor: pointer;
}

.line_card > h2 {
  margin: 80px 0 48px;
}
.line_wrap {
  border-top: 1px #e0e4e6 solid;
  border-bottom: 1px #e0e4e6 solid;
  background-color: #eef6f9;
}
.line_list {
  max-width: 1280px;
  padding: 0 68px;
  margin: 0 auto;
}
.line_list > ul {
  display: flex;
  justify-content: space-between;
}
.line_list > ul > li {
  text-align: center;
  border-left: 1px #dae0e3 solid;
  background-color: #fff;
}
.line_list > ul > li > a {
  position: relative;
  font-size: 1rem;
  transition: backgroung-color 0.3s;
  padding: 5px 0 15px;
}
.line_list > ul > li > a:hover {
  background-color: #ccc;
}
.line_list > ul > li a::after {
  content: "";
  position: absolute;
  bottom: 5px;
  left: 50%;
  width: 7px;
  height: 4px;
  margin-left: -3px;
  background-repeat: no-repeat;
  background-image: url(/img/station/icon_link_arrow_down_off.png);
  background-size: 7px 4px;
}
.line_list > ul > li img {
  width: 100px;
  margin: 0 auto;
  text-align: center;
  z-index: -1;
}
.line_list > ul > li span {
  text-align: center;
  color: #0062b2;
}
.related_link {
  margin: 0 auto;
  text-align: center;
  margin-top: 100px;
  padding-bottom: 150px;
}

.link_wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  max-width: 1146px;
  margin: 0 auto;
  padding-top: 80px;
}
.link_wrap > a {
    position: relative;
    border: 1px solid #ccc;
    display: flex;
    align-items: center;
    font-weight: bold;
  }
.link_wrap > a::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: reba(0, 0, 0, 0.1);
  opacity: 0;
  transition: opacity 0.3s;
  z-index: 1;
}
.link_wrap > a:hover::after {
  opacity: 1;
}
.link_item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.link_item > p {
  display: flex;
  align-items: center;
  padding-left: 30px;
}
.link_item > p::before {
  content: "";
  width: 7px;
  height: 14px;
  background: url("/img/icon_arrow_blue.png") no-repeat;
  background-size: 7px auto;
  margin-top: 2px;
  margin-right: 5px;
}
.pic {
  width: 29.5%;
  margin-left: 4.1%;
  min-width: 30px;
}
.pic > img {
  width: 80%;
  height: auto;
}
</style>